/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						       adv_shipyard.h

	$Header: /game/adv_shipyard.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( ADV_SHIPYARD_H_INCLUDED )
#define ADV_SHIPYARD_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "owned_scriptable_adv_object.h"

struct t_map_rect_2d;
enum   t_town_type;
// ---------------------------------------------------------------
// shipyard adventure object
// ---------------------------------------------------------------

class t_adv_shipyard : public t_owned_scriptable_adv_object
{
public:
	t_adv_shipyard(  std::string const& source );

	virtual void activate_trigger( t_army*		army,	   t_adv_map_point const&	point, 
								   t_direction	direction, t_adventure_frame*	frame );
	bool		 find_new_ship_position( t_adv_map_point & result ) const;

	virtual void left_double_click( t_mouse_event const& event, 
				                    t_adventure_frame* adventure_frame );
	virtual void on_removed();
	virtual void pathing_destination_query( t_adventure_path_point const& source, 
											t_adventure_path_finder & path_finder ) const;
	virtual bool preplacement( t_adventure_map& map, int pass );
	virtual bool read_from_map( std::streambuf& buffer, t_progress_handler* );

	virtual void read_postplacement( t_adventure_map& map );
protected:
	void build_ship( t_town_type alignment );
};

inline t_adv_shipyard::t_adv_shipyard( std::string const& model_name )
	:	t_owned_scriptable_adv_object( model_name )
{
}

#endif // !defined( ADV_SHIPYARD_H_INCLUDED )
